<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="mycrmprkaushik.Customer" %>
<%@ page import="mycrmprkaushik.PMF" %>

<html>
  <body>
  <%	
	String keystring = request.getParameter("key");
	PersistenceManager pm = PMF.get().getPersistenceManager();
	try {
	    Customer c = pm.getObjectById(Customer.class, Long.parseLong(keystring));
	    pm.deletePersistent(c);
	} finally {
	    pm.close();
	}   
    response.sendRedirect("/customers.jsp");   
 %>  	
 </body>
</html>